package com.dengyafei.controller;

import com.dengyafei.domin.vo.AdminLoginVO;
import com.dengyafei.result.RestApiResult;
import com.dengyafei.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 邓亚非
 */
@Slf4j
@RestController
@RequestMapping( "/admin")
public class AdminController {

    @Autowired
    AdminService adminService;

    /**
     * 管理员登录接口
     * @param adminLoginVO
     * @return
     */
    @PostMapping(value = "/adminLogin")
    public RestApiResult adminLogin(@RequestBody AdminLoginVO adminLoginVO){
        String s = adminService.adminLogin(adminLoginVO);
        return RestApiResult.okMsg(s);
    }
}
